package com.skivingcloud.example;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.mybatisflex.core.audit.AuditManager;
import com.skivingcloud.common.utils.ReturnT;
import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author hushouquan
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableEncryptableProperties
@MapperScan(basePackages = { "com.skivingcloud.**.mapper" })
@EnableCaching
@EnableKnife4j
@ComponentScan(basePackages = { "com.skivingcloud.**" })
public class ExampleBootApplication{
    public static void main(String[] args) {
        SpringApplication.run(ExampleBootApplication.class, args);
        AuditManager.setAuditEnable(true);
    }
    
    @GetMapping("/helloWorld")
    @ResponseBody
    public ReturnT<String> helloWorld(){
        return ReturnT.ok("Hello World! Example-server");
    }
    
    @RequestMapping("/")
    public String index(){
        return "index";
    }
}
